var status = -1;
var selectionLog = [];

function action(d, c, b) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            cm.setPartner(1, 1540765, 80001594, 0);
            cm.setPartner(1, 1540766, 80001595, 0);
            cm.setPartner(1, 1540767, 80001596, 0);
            cm.useItem(2023418);
            cm.useItem(2023419);
            cm.useItem(2023420);
            cm.playerMessage(-1, "必须消灭野外的所有怪物, 才能移动到下一地区. ");
            if (cm.getMapId() == 350011100) {
                cm.fieldEffect_ScreenMsg("aswan/stageEff/stage");
                cm.fieldEffect_ScreenMsg("aswan/stageEff/number/1")
            }
            if (cm.getMapId() == 350011200) {
                cm.fieldEffect_ScreenMsg("aswan/stageEff/stage");
                cm.fieldEffect_ScreenMsg("aswan/stageEff/number/2")
            }
            if (cm.getMapId() == 350011300) {
                cm.fieldEffect_ScreenMsg("aswan/stageEff/stage");
                cm.fieldEffect_ScreenMsg("aswan/stageEff/number/3")
            }
            if (cm.getMapId() == 350011800) {
                cm.fieldEffect_ScreenMsg("aswan/stageEff/stage");
                cm.fieldEffect_ScreenMsg("aswan/stageEff/number/4")
            }
            if (cm.getMapId() == 350011900) {
                cm.spawnMobLimit(8240048, 1, 2017, -102, 100);
                cm.addPopupSay(1033228, 3000, "你们来得正好!今天我就给你们来个了断!!", "", 0);
                cm.addPopupSay(1540503, 2000, "怎么会这样!石头居然会说话?", "", 0);
                cm.addPopupSay(1033228, 1000, "啊?!鸟居然会说话!!!", "", 0);
                cm.addPopupSay(1540504, 1000, "...", "", 0);
                cm.updateInfoQuest(33151, "onBoard=1;dagoth=1;monpa=4;halo=1");
                cm.fieldEffect_ScreenMsg("aswan/stageEff/final")
            }
            cm.dispose()
        }
    }
}

function start() {
    status = -1;
    action(1, 0, 0)
};